package com.baili.dao.productionorder;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.baili.dao.base.BaseDao;
import com.baili.dto.ProductOrder;

/**
 * @author iceX
 * @version 创建时间：2016年3月25日 上午11:34:39
 * @Name: ProductionOrderDaoImpl.java
 */
@Repository("ProductionOrderDao")
public class ProductionOrderDaoImpl extends BaseDao implements
		ProductionOrderDao {

	@Override
	public List<Map<String, Object>> getProductionOrderList(
			ProductOrder productOrder) {

		return this.sqlSessionTemplate.selectList("productorder.ifOverWork",
				productOrder);
	}

	@Override
	public List<Map<String, Object>> getApprProductionOrderList(
			ProductOrder productOrder) {

		return this.sqlSessionTemplate.selectList(
				"productorder.ifOverWorkAppr", productOrder);
	}

	@Override
	public int getProductionOrderCount() {
		List list = this.sqlSessionTemplate
				.selectList("productorder.getProductorderList");
		int count = list.size();
		return count;
	}

	@Override
	public List<Map<String, Object>> getProductorderList(
			ProductOrder productOrder) {
		List<Map<String, Object>> list = this.sqlSessionTemplate.selectList(
				"productorder.getProductorderList", productOrder);
		return list;
	}

	@Override
	public List<Map<String, Object>> getApprProductorderList(
			ProductOrder productOrder) {
		List<Map<String, Object>> list = this.sqlSessionTemplate.selectList(
				"productorder.getApprProductorderList", productOrder);
		return list;
	}

	@Override
	public List queryProductionOrderDetailsList(ProductOrder productOrder) {

		return this.sqlSessionTemplate.selectList(
				"productorder.queryProductionOrderDetailsList", productOrder);
	}

	@Override
	public List getqualityChecksByTime(ProductOrder productOrder) {
		return this.sqlSessionTemplate.selectList(
				"productorder.getqualityChecksByTime", productOrder);
	}

	@Override
	public List getqualityChecksByproductNo(String productNo) {

		return this.sqlSessionTemplate.selectList(
				"productorder.getqualityChecksByproductNo", productNo);

	}

	@Override
	public List getqualityChecksByNumbers(String numbers) {

		return this.sqlSessionTemplate.selectList(
				"productorder.getqualityChecksByproductNo", numbers);
	}

	@Override
	public List getqualityChecksByProcess(String process) {

		return this.sqlSessionTemplate.selectList(
				"productorder.getqualityChecksByproductNo", process);
	}

	@Override
	public List getProductionOrderByScheduleNo(ProductOrder order) {

		return this.sqlSessionTemplate.selectList(
				"productorder.getProductionOrderByScheduleNo", order);
	}

	@Override
	public void updateRoundTypeByProductCode(ProductOrder productOrder) {

		List<Map<String, Object>> finishedLst = this.sqlSessionTemplate
				.selectList("productorder.getProductOrderForFinished",
						productOrder);

		if (productOrder.getRoundType() == 2) {

			List<Map<String, Object>> basicLst = this.sqlSessionTemplate
					.selectList("productorder.getProductOrderForBasic",
							productOrder);

			for (Map<String, Object> basicMap : basicLst) {
				// 获取到单个鞋码的整体产品数量如：需要生产的成品是鞋码225的50双

				int size = Integer.parseInt(basicMap.get("size").toString());

				int productCount = Integer.parseInt(basicMap
						.get("productCount").toString());

				productOrder.setSize(size);

				List<Map<String, Object>> finishedBySizeLst = this.sqlSessionTemplate
						.selectList(
								"productorder.getProductOrderForFinishedBySize",
								productOrder);

				// 取得指定尺码且轮次已经制定的数量
				for (Map<String, Object> finishedBySizeMap : finishedBySizeLst) {

					if (finishedBySizeMap != null) {

						int finishedBySizeProductCount = Integer
								.parseInt(finishedBySizeMap.get("productCount")
										.toString());

						if (productCount == finishedBySizeProductCount) {

							productOrder.setDisplayControl(1);
							// 对数据库内的生产通知单信息的DisplayControl(成品显示)字段进行更新将其置为1，即为1时不可显示在成品未计划列表内
							this.sqlSessionTemplate
									.update("productorder.updateRoundTypeByProductCodeBasic",
											productOrder);
						}
					}
				}
			}
		}

		if (finishedLst != null && finishedLst.size() > 0) {

			if (productOrder.getRoundType() == 2) {

				productOrder.setMatchingStaffType(1);
			}
		}

		this.sqlSessionTemplate.update(
				"productorder.updateRoundTypeByProductCode", productOrder);
	}

	@Override
	public void queryProductionOrderParameter(ProductOrder order, String flag) {

		// 如果不为成品则查询半成品将其显示出来
		if (flag.equals("1")) {
			// //如果为成品则查出已配帮齐套的鞋号并将其轮次以size由小到大的顺序展现出来并更新轮次
			//
			// //noRoundLst=查询出未分配信息(成品)(round=0 and roundType=0)
			// List<Map<String,Object>>noRoundLst =
			// this.sqlSessionTemplate.selectList("productorder.queryProductionOrderParameterFNoRound",
			// order);
			//
			// //roundTypeLst=查询出已分配信息(成品)(roundType>0)并获得其最大轮次
			// List<Map<String,Object>>roundTypeLst =
			// this.sqlSessionTemplate.selectList("productorder.queryProductionOrderParameterFRoundType",
			// order);
			//
			// //roundTypeRoundLst=查询出已分配信息(成品)(round>0 and roundType=0)
			// List<Map<String,Object>>roundTypeRoundLst =
			// this.sqlSessionTemplate.selectList("productorder.queryProductionOrderParameterFRoundTypeRound",
			// order);
			//
			// int oldMaxRound = 0;
			// //第四步：取出已分配轮次的最大值
			// if(roundTypeLst != null && roundTypeLst.size()>0 &&
			// roundTypeLst.get(0) != null){
			//
			// oldMaxRound =
			// Integer.parseInt(roundTypeLst.get(0).get("round").toString());
			//
			// }
			// //第五步：以最大值为基准将未分配轮次的数据更新
			//
			// if(noRoundLst != null && noRoundLst.size() > 0 &&
			// noRoundLst.get(0) != null ){
			//
			// if(roundTypeLst != null && roundTypeLst.size() > 0 &&
			// roundTypeLst.get(0) != null ){
			//
			// if(roundTypeRoundLst != null && roundTypeRoundLst.size() > 0 &&
			// roundTypeRoundLst.get(0) != null ){
			// // 删除roundType = 0 且round > 0的
			// List<Map<String,Object>>roundTypeRoundTotalLst =
			// this.sqlSessionTemplate.selectList("productorder.queryProductionOrderParameterFRoundTypeRoundTotalT",
			// order);
			// //判断是否有变动
			// int fg = 0;
			//
			// for(Map<String,Object> norMap:noRoundLst){
			//
			// for(Map<String,Object> rtrtMap:roundTypeRoundTotalLst){
			//
			// if(norMap.get("size").toString().equals(rtrtMap.get("size").toString())){
			//
			// if(Integer.parseInt(norMap.get("matchingStaffCount").toString())
			// > Integer.parseInt(rtrtMap.get("productCount").toString()) ||
			// noRoundLst.size() > roundTypeRoundTotalLst.size()){
			//
			// fg = fg + 1;
			// }
			// }
			// }
			// }
			//
			// if(fg > 0){
			//
			// for(Map<String,Object> rtrMap:roundTypeRoundLst){
			//
			// order.setId(Integer.parseInt(rtrMap.get("id").toString()));
			//
			// this.sqlSessionTemplate.delete("productorder.deleteProductOrder",
			// order);
			// }
			// // 将noRoundLst与roundTypeLst按照鞋号匹配(productCount要SUM)
			//
			// int round = oldMaxRound;
			//
			// for(Map<String,Object> norMap:noRoundLst){
			//
			// List<Map<String,Object>>roundTypeCountLst =
			// this.sqlSessionTemplate.selectList("productorder.queryProductionOrderParameterFRoundTypeCount",
			// order);
			// int count = 0;
			// for(Map<String,Object> rtMap:roundTypeCountLst){
			//
			// if(norMap.get("size").toString().equals(rtMap.get("size").toString())){
			//
			// count = count + 1;
			//
			// int matchingStaffCount =
			// Integer.parseInt(norMap.get("matchingStaffCount").toString());
			//
			// int productCount =
			// Integer.parseInt(rtMap.get("productCount").toString());
			//
			// if(matchingStaffCount > productCount){
			//
			// round = round + 1;
			//
			// //
			// 拆分noRoundLst将已配帮的的拆出来,形成新的数据(matchingStaffCount-productCount为新记录的productCount)
			// ProductOrder productOrder = new ProductOrder();
			//
			// productOrder.setId(Integer.parseInt(norMap.get("id").toString()));
			//
			// ProductOrder orderCF =
			// this.getProductionOrderByRoundAndProductCode(productOrder);
			//
			// orderCF.setProductCount(matchingStaffCount-productCount);
			//
			// orderCF.setRound(round);
			// // 增加轮次
			// this.insertProductionOrderByRoundAndSize(orderCF);
			// }
			// }
			// }
			//
			// if(count == 0){
			// round = round + 1;
			// //
			// 拆分noRoundLst,将已配帮的拆出来,形成新的数据(matchingStaffCount为新记录的productCount)
			//
			// ProductOrder productOrder = new ProductOrder();
			//
			// productOrder.setId(Integer.parseInt(norMap.get("id").toString()));
			//
			// ProductOrder orderCF =
			// this.getProductionOrderByRoundAndProductCode(productOrder);
			//
			// orderCF.setProductCount(orderCF.getMatchingStaffCount());
			//
			// orderCF.setRound(round);
			// // 增加轮次
			// this.insertProductionOrderByRoundAndSize(orderCF);
			//
			// }
			// }
			// }
			//
			// }else{
			// // 将noRoundLst与roundTypeLst按照鞋号匹配(productCount要SUM)
			//
			// int round = oldMaxRound;
			//
			// for(Map<String,Object> norMap:noRoundLst){
			//
			// List<Map<String,Object>>roundTypeCountLst =
			// this.sqlSessionTemplate.selectList("productorder.queryProductionOrderParameterFRoundTypeCount",
			// order);
			// int count = 0;
			// for(Map<String,Object> rtMap:roundTypeCountLst){
			//
			// if(norMap.get("size").toString().equals(rtMap.get("size").toString())){
			//
			// count = count + 1;
			//
			// int matchingStaffCount =
			// Integer.parseInt(norMap.get("matchingStaffCount").toString());
			//
			// int productCount =
			// Integer.parseInt(rtMap.get("productCount").toString());
			//
			// if(matchingStaffCount > productCount){
			//
			// round = round + 1;
			//
			// //
			// 拆分noRoundLst将已配帮的的拆出来,形成新的数据(matchingStaffCount-productCount为新记录的productCount)
			// ProductOrder productOrder = new ProductOrder();
			//
			// productOrder.setId(Integer.parseInt(norMap.get("id").toString()));
			//
			// ProductOrder orderCF =
			// this.getProductionOrderByRoundAndProductCode(productOrder);
			//
			// orderCF.setProductCount(matchingStaffCount-productCount);
			//
			// orderCF.setRound(round);
			// // 增加轮次
			// this.insertProductionOrderByRoundAndSize(orderCF);
			// }
			// }
			// }
			//
			// if(count == 0){
			// round = round + 1;
			// //
			// 拆分noRoundLst,将已配帮的拆出来,形成新的数据(matchingStaffCount为新记录的productCount)
			//
			// ProductOrder productOrder = new ProductOrder();
			//
			// productOrder.setId(Integer.parseInt(norMap.get("id").toString()));
			//
			// ProductOrder orderCF =
			// this.getProductionOrderByRoundAndProductCode(productOrder);
			//
			// orderCF.setProductCount(orderCF.getMatchingStaffCount());
			//
			// orderCF.setRound(round);
			// // 增加轮次
			// this.insertProductionOrderByRoundAndSize(orderCF);
			//
			// }
			// }
			// }
			//
			// }else{
			//
			// if(roundTypeRoundLst != null && roundTypeRoundLst.size() > 0 &&
			// roundTypeRoundLst.get(0) != null ){
			//
			// // 将noRoundLst与roundTypeRoundLst按照鞋号匹配(productCount要SUM)
			// // 删除roundType = 0 且round > 0的
			//
			// List<Map<String,Object>>roundTypeRoundTotalLst =
			// this.sqlSessionTemplate.selectList("productorder.queryProductionOrderParameterFRoundTypeRoundTotal",
			// order);
			// //判断是否有变动
			// int fg = 0;
			//
			// for(Map<String,Object> norMap:noRoundLst){
			//
			// for(Map<String,Object> rtrtMap:roundTypeRoundTotalLst){
			//
			// if(norMap.get("size").toString().equals(rtrtMap.get("size").toString())){
			//
			// if(Integer.parseInt(norMap.get("matchingStaffCount").toString())
			// > Integer.parseInt(rtrtMap.get("productCount").toString()) ||
			// noRoundLst.size() > roundTypeRoundTotalLst.size()){
			//
			// fg = fg + 1;
			// }
			// }
			// }
			// }
			//
			// if(fg > 0){
			//
			// for(Map<String,Object> rtrMap:roundTypeRoundLst){
			//
			// order.setId(Integer.parseInt(rtrMap.get("id").toString()));
			//
			// this.sqlSessionTemplate.delete("productorder.deleteProductOrder",
			// order);
			//
			// }
			//
			// int round = 0;
			//
			// for(Map<String,Object> norMap:noRoundLst){
			//
			// round = round + 1;
			// //
			// 拆分noRoundLst,将已配帮的拆出来,形成新的数据(matchingStaffCount为新记录的productCount)
			//
			// ProductOrder productOrder = new ProductOrder();
			//
			// productOrder.setId(Integer.parseInt(norMap.get("id").toString()));
			//
			// ProductOrder orderCF =
			// this.getProductionOrderByRoundAndProductCode(productOrder);
			//
			// orderCF.setProductCount(orderCF.getMatchingStaffCount());
			//
			// orderCF.setRound(round);
			// // 增加轮次
			// this.insertProductionOrderByRoundAndSize(orderCF);
			// }
			// }
			// }else{
			//
			// int round = 0;
			//
			// for(Map<String,Object> norMap:noRoundLst){
			//
			// round = round + 1;
			//
			// //
			// 拆分noRoundLst,将已配帮的拆出来,形成新的数据(matchingStaffCount为新记录的productCount)
			//
			// ProductOrder productOrder = new ProductOrder();
			//
			// productOrder.setId(Integer.parseInt(norMap.get("id").toString()));
			//
			// ProductOrder orderCF =
			// this.getProductionOrderByRoundAndProductCode(productOrder);
			//
			// orderCF.setProductCount(orderCF.getMatchingStaffCount());
			//
			// orderCF.setRound(round);
			// // 增加轮次
			// this.insertProductionOrderByRoundAndSize(orderCF);
			// }
			// }
			// }
			// }

		} else if (flag.equals("2")) {

			// 第二步：查询是否未排轮次，若未排，则更新轮次，若已排，则显示
			List<Map<String, Object>> lstPTwo = this.sqlSessionTemplate
					.selectList(
							"productorder.queryProductionOrderParameterPTwoStep",
							order);

			if (lstPTwo != null && lstPTwo.size() > 0) {

				for (int i = 0; i < lstPTwo.size(); i++) {

					int id = Integer.parseInt(lstPTwo.get(i).get("id")
							.toString());

					ProductOrder updateRoundProductOrder = new ProductOrder();

					updateRoundProductOrder.setId(id);

					updateRoundProductOrder.setRound(i + 1);

					this.sqlSessionTemplate.update(
							"productorder.updateProductionOrder",
							updateRoundProductOrder);
				}
			}
		}
	}

	@Override
	public List queryProductionOrderParameterFOrP(ProductOrder order,
			String flag) {
		List<Map<String, Object>> lst = new ArrayList<Map<String, Object>>();

		if (flag.equals("1")) {

			if (order.getRoundType() == 0 || order.getRoundType() == 3) {

				// 查询所有已轮次的产品，并显示出来
				lst = this.sqlSessionTemplate
						.selectList(
								"productorder.queryProductionOrderParameterFSixStepAll",
								order);

			} else {

				// 查询所有已轮次的产品，并显示出来
				lst = this.sqlSessionTemplate.selectList(
						"productorder.queryProductionOrderParameterFSixStep",
						order);

			}

		} else if (flag.equals("2")) {
			// 第三步：查询所有已轮次的产品，并显示出来
			lst = this.sqlSessionTemplate.selectList(
					"productorder.queryProductionOrderParameterPThreeStep",
					order);
		}
		return lst;
	}

	@Override
	public void deleteProductOrderById(ProductOrder order) {

		// List<Map<String,Object>>lst = new ArrayList<Map<String,Object>>();

		// ProductOrder orderCF =
		// this.getProductionOrderByRoundAndProductCode(order);

		this.sqlSessionTemplate
				.delete("productorder.deleteProductOrder", order);

	}

	@Override
	public void updateProductionOrderByRoundAndSize(ProductOrder productOrder) {

		this.sqlSessionTemplate.update(
				"productorder.updateProductionOrderByRoundAndSize",
				productOrder);
	}

	@Override
	public void insertProductionOrderByRoundAndSize(ProductOrder productOrder) {
		this.sqlSessionTemplate.insert(
				"productorder.insertProductionOrderByRoundAndSize",
				productOrder);
	}

	@Override
	public ProductOrder getProductionOrderByRoundAndProductCode(
			ProductOrder productOrder) {
		// 靠productOrder的Id 获取该Id的生产通知单信息
		return this.sqlSessionTemplate.selectOne(
				"productorder.getProductionOrderByRoundAndProductCode",
				productOrder);
	}

	@Override
	public ProductOrder getProductionOrderByRound(ProductOrder productOrder) {

		return this.sqlSessionTemplate.selectOne(
				"productorder.getProductionOrderByRound", productOrder);
	}

	@Override
	public int getMaxRound(ProductOrder productOrder) {

		List<Map<String, Object>> lstP = this.sqlSessionTemplate.selectList(
				"planner.handleProductOrderByProductCodeP", productOrder);

		List<Map<String, Object>> lstF = this.sqlSessionTemplate.selectList(
				"planner.handleProductOrderByProductCodeF", productOrder);

		int round = 0;

		if (lstF != null && lstF.size() > 0) {

			List<Map<String, Object>> roundLst = this.sqlSessionTemplate
					.selectList("productorder.getMaxRoundF", productOrder);

			if (roundLst != null && roundLst.size() > 0) {

				for (Map<String, Object> map : roundLst) {

					round = Integer.parseInt(map.get("round").toString());
				}
			}

		} else if (lstP != null && lstP.size() > 0) {

			round = this.sqlSessionTemplate.selectOne(
					"productorder.getMaxRoundP", productOrder);
		}

		return round;
	}

	@Override
	public int getMaxRoundFFinished(ProductOrder productOrder) {

		int round = 0;

		List<Map<String, Object>> roundLst = this.sqlSessionTemplate
				.selectList("productorder.getMaxRoundFFinished", productOrder);

		if (roundLst != null && roundLst.size() > 0) {

			for (Map<String, Object> map : roundLst) {
				
				if(map != null && map.get("round") != null){
					
					round = Integer.parseInt(map.get("round").toString());
				}
			}
		}

		return round;
	}

	@Override
	public List<Map<String, Object>> selectProduction(String startTime,
			String endTime) {
		Map map = new HashMap();
		map.put("startTime", startTime);
		map.put("overTime", endTime);
		List<Map<String, Object>> lst = this.sqlSessionTemplate.selectList(
				"productorder.selectProduction", map);

		return lst;
	}

	public List selectUserByRoleType() {

		List<Map<String, Object>> lst = new ArrayList<Map<String, Object>>();

		List<Map<String, Object>> resultLst = new ArrayList<Map<String, Object>>();

		int MCount = 0;// 管理人员
		int PCount = 0;// 计划人员
		int OCount = 0;// 操作人员
		int CCount = 0;// 查验人员

		lst = this.sqlSessionTemplate
				.selectList("productorder.selectUserByRoleType");

		for (Map<String, Object> map : lst) {

			if (map.get("roleName").toString().equals("管理员")
					|| map.get("roleName").toString().equals("企业领导")) {

				MCount = MCount
						+ Integer.parseInt(map.get("roleCount").toString());

			} else if (map.get("roleName").toString().equals("成品计划员")
					|| map.get("roleName").toString().equals("半成品计划员")) {

				PCount = PCount
						+ Integer.parseInt(map.get("roleCount").toString());

			} else if (map.get("roleName").toString().equals("操作人员")
					|| map.get("roleName").toString().equals("配帮人员")) {

				OCount = OCount
						+ Integer.parseInt(map.get("roleCount").toString());

			} else if (map.get("roleName").toString().equals("检验人员")) {

				CCount = CCount
						+ Integer.parseInt(map.get("roleCount").toString());
			}
		}

		Map<String, Object> MMap = new HashMap<String, Object>();
		MMap.put("id", 1);
		MMap.put("roleName", "管理人员");
		MMap.put("roleCount", MCount);
		resultLst.add(MMap);
		Map<String, Object> PMap = new HashMap<String, Object>();
		PMap.put("id", 2);
		PMap.put("roleName", "计划人员");
		PMap.put("roleCount", PCount);
		resultLst.add(PMap);
		Map<String, Object> OMap = new HashMap<String, Object>();
		OMap.put("id", 3);
		OMap.put("roleName", "操作人员");
		OMap.put("roleCount", OCount);
		resultLst.add(OMap);
		Map<String, Object> CMap = new HashMap<String, Object>();
		CMap.put("id", 4);
		CMap.put("roleName", "检验人员");
		CMap.put("roleCount", CCount);
		resultLst.add(CMap);
		return resultLst;
	}

	@Override
	public int getUsersTypeCount() {

		return this.sqlSessionTemplate
				.selectOne("productorder.getUsersTypeCount");
	}

	@Override
	public List getqualityChecksByMany(String productCode, String processName,
			String startTime, String endTime) {

		Map map = new HashMap();

		map.put("productCode", productCode);

		map.put("processName", processName);

		map.put("startTime", startTime);

		map.put("overTime", endTime);

		// List<Map<String,Object>> totalList =
		// this.sqlSessionTemplate.selectList("productorder.getqualityChecksByManyTotal",map);

		List<Map<String, Object>> lst = this.sqlSessionTemplate.selectList(
				"productorder.getqualityChecksByMany", map);

		int totalCount = 0;

		if (lst != null && lst.size() > 0) {

			for (Map<String, Object> totalMap : lst) {

				if (totalMap != null) {

					totalCount = totalCount
							+ Integer.parseInt(totalMap.get("defectCount")
									.toString());
				}
			}

			for (Map<String, Object> totalMap : lst) {

				if (totalMap != null) {

					totalMap.put("totalCount", totalCount);
				}
			}
		}
		return lst;
	}

	@Override
	public int getqualityChecksSum() {

		return this.sqlSessionTemplate
				.selectOne("productorder.getqualityChecksSum");
	}

	@Override
	public List getPrList() {
		return this.sqlSessionTemplate.selectList("productorder.getPrList");
	}

	public void updateProductionOrder(ProductOrder productOrder) {

		this.sqlSessionTemplate.update("productorder.updateProductionOrder",
				productOrder);
	}

	@Override
	public List selectSizeAndCount(String code) {

		return this.sqlSessionTemplate.selectList(
				"productorder.selectSizeAndCount", code);
	}

	@Override
	public List selectCount(String code) {

		return this.sqlSessionTemplate.selectList("productorder.selectCount",
				code);
	}

	@Override
	public ProductOrder getProductionOrderById(ProductOrder productOrder) {

		return this.sqlSessionTemplate.selectOne(
				"productorder.getProductionOrderById", productOrder);
	}

	@Override
	public ProductOrder getOrderById(ProductOrder productOrder) {

		return this.sqlSessionTemplate.selectOne("productorder.getOrderById",
				productOrder);
	}

	@Override
	public List selectProductTeamList() {

		// TODO Auto-generated method stub
		return this.sqlSessionTemplate
				.selectList("productorder.selectProductTeamList");
	}

	@Override
	public List queryProductionOrderParameterFOneStep(ProductOrder order) {

		return this.sqlSessionTemplate.selectList(
				"productorder.queryProductionOrderParameterFOneStep", order);
	}

	@Override
	public List queryProductionOrderParameterPOneStep(ProductOrder order) {

		return this.sqlSessionTemplate.selectList(
				"productorder.queryProductionOrderParameterPOneStep", order);
	}

	@Override
	public void deleteProductOrder(ProductOrder order) {

		this.sqlSessionTemplate
				.delete("productorder.deleteProductOrder", order);
	}

	@Override
	public List getProductOrderRound(ProductOrder order) {

		return this.sqlSessionTemplate.selectList(
				"productorder.getProductOrderRound", order);
	}

	@Override
	public List getProductOrderRoundByRoundType(ProductOrder order) {

		return this.sqlSessionTemplate.selectList(
				"productorder.getProductOrderRoundByRoundType", order);
	}

	@Override
	public List getProLst(ProductOrder order) {

		return this.sqlSessionTemplate.selectList("productorder.getProLst",
				order);
	}

}
